using System;
using System.Data;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DetailsViewPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string query=
            "select Email,CompanyName," +
            "ContactName, Address,Phone " +
            "from tblRCAccounts ";
            LoadData(query);
        }
    }
    void LoadData(string query)
    {
        string connectionString =
        WebConfigurationManager.ConnectionStrings[
        "RCVDB2000"].ConnectionString;

        ControlHelper cls = new
        ControlHelper(connectionString);
        cls.CommandText = query;
        cls.CommandType = CommandType.Text;
        
        cls.InitProperties();
        cls.FillDataTableToDetailsView(
        DetailsView1,5,PagerButtons.Numeric);
    }
}
